﻿using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using DevExpress.XtraReports.UI;

namespace SchoolManagementSystem.Report._3._KeToan
{
    public partial class BaoCaoTheoDoiHocPhi : DevExpress.XtraReports.UI.XtraReport
    {
        int STT = 0;
        public DateTime StartDate;
        public DateTime EndDate;
        public long TotalHPPhaiThu;
        public long TotalHPDaThu;
        public long TotalHPNo;
        public BaoCaoTheoDoiHocPhi()
        {
            InitializeComponent();
        }

        private void Detail_BeforePrint(object sender, System.Drawing.Printing.PrintEventArgs e)
        {
            try
            {
                STT++;
                xrTableCell_STT.Text = STT.ToString();
                var moneypay = long.Parse(GetCurrentColumnValue("MoneyPay").ToString());
                var moneypaid = long.Parse(GetCurrentColumnValue("MoneyPaid").ToString());
                var moneynotpaid = long.Parse(GetCurrentColumnValue("MoneyNotPaid").ToString());
                xrTableCell_MoneyPay.Text = Helper.StringHelper.FormatVND(moneypay);
                xrTableCell_moneypaid.Text = Helper.StringHelper.FormatVND(moneypaid);
                xrTableCell_MoneyNotPaid.Text = Helper.StringHelper.FormatVND(moneynotpaid);
            }
            catch { }

        }

        private void ReportHeader_BeforePrint(object sender, System.Drawing.Printing.PrintEventArgs e)
        {
            xrLabel_Ngay.Text = "Từ " + StartDate.ToShortDateString() +" đến " + EndDate.ToShortDateString();
        }

        private void ReportFooter_BeforePrint(object sender, System.Drawing.Printing.PrintEventArgs e)
        {
            xrTableCell_DaThu.Text = Helper.StringHelper.FormatVND(TotalHPDaThu);
            xrTableCell_PhaiThu.Text = Helper.StringHelper.FormatVND(TotalHPPhaiThu);
            xrTableCell_No.Text = Helper.StringHelper.FormatVND(TotalHPNo);
        }

    }
}
